package cn.wolfcode.crm.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@Setter
@Getter
public class Employee {

    public static  final String PASSWORD_DE = "666"; //默认密码
    public static  final int BE_ON_THE_JOB  = 1; //员工状态默认在职
    public static  final int DIMISSION  = 0; //员工状态

    private Long id;

    private String username;

    private String realname;

    private String password=PASSWORD_DE;

    private String tel;

    private String email;

    private Department dept;

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    private Date hiredate;

    private int state=BE_ON_THE_JOB;

    private boolean admin;

    private String img;

    //维护角色关系
    private List<Role> roles=new ArrayList<>();

}